import store from '../store'

import {
    INCREMENTCOUNT,
    DECREMENTCOUNT
} from '../constnant/countConst'

//累加
export const incrementAction = (data) => {
    return {
        type: INCREMENTCOUNT,
        data
    }
}

//累减
export const decrementAction = (data) => {
    return {
        type: DECREMENTCOUNT,
        data
    }
}


//异步累加
export const waitincrementAction = (data) => {
    return () => {
        setTimeout(() => {
            store.dispatch ({
                type: INCREMENTCOUNT,
                data
            })
        }, 2000);
    }
}